package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @version 1.0
 * @Author 郭腾高
 * @Date 2024/9/16 22:55
 */
@Mapper
public interface DishFlavorMapper {
    /*
    * 批量插入口味数据
    * */

    void insertBach(List<DishFlavor> flavors);

    /*
    * 根据菜品id删除对应口味 传多个id
    * */
    void deleteByDishId(List<Long> ids);

    /*
    * 根据菜品id删除对应口味id  传单个id
    * */
    @Delete("delete from dish_flavor where dish_id =#{id}")
    void deleteByDishIdOneId(Long id);
    /*
    * 根据菜品id查询口味信息
    * */
    @Select("select * from dish_flavor where dish_id=#{DishId}")
    List<DishFlavor> getByDishId(Long DishId);
}
